import request from '@/utils/request'

//   /api/regions
// 按搜索条件分页查询
export function getRegions(data) {
    return request({
      url: '/api/regions',
      method: 'get',
        params:data
    })
  }
// POST /api/regions
// 新增战区/省区
export function addRegions(data) {
    return request({
      url: '/api/regions',
      method: 'post',
        data
    })
  }
// PUT /api/regions
// 根据id修改战区/省区
export function updateRegions(data) {
    return request({
      url: '/api/regions',
      method: 'put',
        data
    })
  }
// GET /api/regions/all
// 获取所有战区数据
export function getRegionsAll() {
    return request({
      url: '/api/regions/all',
      method: 'get',
       
    })
  }
// DELETE /api/regions/{id}
// 根据id删除战区/或省区
export function delRegions(id) {
    return request({
      url: `/api/regions/${id}`,
      method: 'delete',
       
    })
  }
//   GET /api/regions/{id}/provinces
//   根据战区主键id,获取战区下的省区
  
// /api/regions/{id}/provinces
export function RegionsProvince(id) {
    return request({
      url: `/api/regions/${id}/provinces`,
      method: 'get',
       
    })
  }

  // /api/customerSuccess/{id}/subteams
  export function teamNamesProvince(id) {
    return request({
      url: `/api/customerSuccess/${id}/subteams`,
      method: 'get',
       
    })
  }
  // getteamNames,
  // addteamNames,
  // teamNamesProvince,
  // updateteamNames,
  // getteamNamesAll,
  // delteamNames,
  export function getteamNames(data) {
    return request({
      url: '/api/customerSuccess',
      method: 'get',
        params:data
    })
  }
  export function getteamNamesAll() {
    return request({
      url: '/api/customerSuccess/all',
      method: 'get'
        
    })
  }
  export function addteamNames(data) {
    return request({
      url: '/api/customerSuccess',
      method: 'post',
        data
    })
  }
  export function updateteamNames(data) {
    return request({
      url: '/api/customerSuccess',
      method: 'put',
        data
    })
  }
  export function delteamNames(id) {
    return request({
      url: `/api/customerSuccess/${id}`,
      method: 'delete',
       
    })
  }
  // /api/customerSuccess/tree
  export function customerSuccess(){
    return request({
      url: '/api/customerSuccess/tree',
      method: 'get',
       
    })
  }